<?php

namespace app\models;

use Yii;

/**
 * Course is the ActiveRecord behind the contact form.
 */
class CourseItem extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'b_course_item';
    }
    /**
     * @return array the validation rules.
     */
    public function rules()
    {
        return [
            [['id', 'title', 'pid', 'course_id', 'type'], 'required'],
            [['id', 'pid', 'course_id', 'create_by', 'update_by'], 'string', 'max' => 255],
            [['title', 'is_leaf', 'type', 'state'], 'string', 'max' => 255],
            [['content'], 'string', 'max' => 4000],
        ];
    }

    /**
     * @return array customized attribute labels
     */
    public function attributeLabels()
    {
        return [
            'title' => 'Title',
        ];
    }
}
